//***********************************************************************************
// Test player object for level abstraction

// Author: Aravindh U095232L

//***********************************************************************************


//Player controller object
function playerObj(){

this.id = 0;

this.pos_x = 200;
this.pos_y = 200;
this.width = 20;
this.height = 20;
this.orientation = 0;
this.grid = [];
this.see = [];

this.play = new Image();
this.play.src = "Images/test.png";

//Player move function
this.move = function()
{
  	 if(keyStroke == '38')  // Player holding up
        {
           this.pos_y -=20;
           keyStroke = '-1';
        }
     else if(keyStroke == '37') // Player holding left
        {
           this.pos_x -=20;
           keyStroke = '-1';
        }	
     else if(keyStroke == '39') // Player holding right 
        {
           this.pos_x +=20;
           keyStroke = '-1';
        }
     else if(keyStroke == '40') // Player holding down
        {
           this.pos_y +=20;
           keyStroke = '-1';
        }   

      this.grid = findgrid(this);  

}

//Player rendering function
this.draw=function(){
ctx.drawImage(this.play, this.pos_x, this.pos_y,this.width,this.height);
}

};